package com.probiz.estore.system.dao.impl;

import java.util.List;

import com.probiz.estore.system.dao.SmsQueueDao;
import com.probiz.estore.common.model.system.SmsQueue;
import com.probiz.estore.core.dao.impl.HibernateGenericDaoImpl;

/**
 * Dao implementation for SmsQueue.
*/
public class SmsQueueDaoImpl extends HibernateGenericDaoImpl<SmsQueue> implements SmsQueueDao {	
	/**
	 * 查询出前maxPage条用于发送
	 * 
	 * */
	public List<SmsQueue> getSmsQueueToSend(int maxPage, int sendMaxNum){
		String hql = "from SmsQueue s where s.status=0 and s.sendMaxNum<=? order by s.createTime asc";
		return this.findByHqlPaged(hql, 0, maxPage, new Object[]{sendMaxNum});
	}
}
